import java.util.*;

public class DuplicateFolder {
    static class TrieNode {
        String name;
        Map<String, TrieNode> children = new HashMap<>();
        String structure; // 用于存储当前文件夹的结构
        TrieNode(String name) {
            this.name = name;
        }
    }

    static Map<String, List<TrieNode>> structureMap = new HashMap<>();
    static Set<String> duplicateFolders = new HashSet<>();

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.nextLine());
        TrieNode root = new TrieNode(""); // 文件夹树的根节点

        // 构建文件夹的树结构
        for (int i = 0; i < n; i++) {
            String[] path = sc.nextLine().split("/");
            addPath(root, path);
        }

        // 递归地遍历树，标记重复的文件夹
        findDuplicates(root);

        // 将结果按字典序排序
        List<String> result = new ArrayList<>(duplicateFolders);
        Collections.sort(result);

        if (result.isEmpty()) {
            System.out.println("NotFound");
        } else {
            for (String folder : result) {
                System.out.println(folder);
            }
        }
    }

    // 添加路径到文件夹树
    private static void addPath(TrieNode root, String[] path) {
        TrieNode current = root;
        for (String folder : path) {
            if (folder.isEmpty()) continue; // 忽略空文件夹
            current.children.putIfAbsent(folder, new TrieNode(folder));
            current = current.children.get(folder);
        }
    }

    // 递归遍历文件夹树，找到重复的文件夹
    private static String findDuplicates(TrieNode node) {
        if (node.children.isEmpty()) {
            return "";
        }

        StringBuilder sb = new StringBuilder();
        List<String> subFolderStructures = new ArrayList<>();

        // 遍历所有子文件夹
        for (TrieNode child : node.children.values()) {
            String subStructure = findDuplicates(child);
            subFolderStructures.add(child.name + "(" + subStructure + ")");
        }

        // 按字典序排列子文件夹
        Collections.sort(subFolderStructures);
        for (String sub : subFolderStructures) {
            sb.append(sub);
        }

        // 当前文件夹的结构表示
        String structure = sb.toString();
        node.structure = structure;

        // 如果该结构已经存在，则标记为重复
        if (!structure.isEmpty()) {
            structureMap.putIfAbsent(structure, new ArrayList<>());
            structureMap.get(structure).add(node);
            if (structureMap.get(structure).size() > 1) {
                for (TrieNode duplicateNode : structureMap.get(structure)) {
                    duplicateFolders.add(getFullPath(duplicateNode));
                }
            }
        }

        return structure;
    }

    // 递归地构造完整路径
    private static String getFullPath(TrieNode node) {
        List<String> path = new ArrayList<>();
        while (node != null && !node.name.isEmpty()) {
            path.add(node.name);
            node = node.children.get(".."); // 模拟父节点的访问方式
        }
        Collections.reverse(path);
        return "/" + String.join("/", path) + "/";
    }
}
